﻿<%@ Page Title="Làm bài thi" Language="C#" MasterPageFile="~/HocVien/HocVien.master" AutoEventWireup="true" CodeFile="frmBaiThi.aspx.cs" Inherits="HocVien_frmBaiThi" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server" >
    <table style="width: 100%">
        <tr>
            <td colspan="2">
                &nbsp;Mã Đề Thi:
                <asp:Label ID="lblMaDT" runat="server" Text="lblmadt" ForeColor="#999966"></asp:Label>
                <br />
                &nbsp;Mã Bài Thi:
                <asp:Label runat="server" Text="mabaithi" ID="lblmabt" ForeColor="#999966"></asp:Label>
                <br />
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;<span style="font-family:Times New Roman;font-size:large;">Ngày:
                <asp:Label ID="lblNgayGio" runat="server" Text="lblShortDatetime"></asp:Label></span>
                <br />
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                <asp:Label ID="lblTenBaiThi" runat="server" BorderStyle="None" 
                    ForeColor="#003300" Text="Bai Kiem Tra  Cuoi Ky" Font-Bold=True 
                    Height="17px"></asp:Label> 
                <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                
                <br />
                <asp:Panel ID="Panel2" runat="server" BackColor="#FFFFCC" BorderStyle="Groove" 
                    Width="186px">
                    <asp:Label ID="lbltenma" runat="server" Text="Mã Thí Sinh: "></asp:Label>
                    <asp:Label ID="lblMathisinh" runat="server" Font-Bold="true" Font-Italic="true" 
                        ForeColor="Gray"></asp:Label>
                </asp:Panel>
                <br />
            </td>
        </tr>
        <tr>
            <td style="width: 64%;" rowspan="6">
           

                <asp:Panel ID="Panel1" runat="server" ScrollBars="Both" 
                    HorizontalAlign="Justify" Height="660px">
                    <asp:DataList ID="DataList1" runat="server" GridLines="Vertical" 
                        RepeatLayout="Flow" style="margin-top:10px;">
                        <ItemTemplate>
                            <asp:Label ID="lblMaCH" runat="server" Text='<%# Eval("MaCH1") %>' 
                            Visible="False"></asp:Label>
                            <asp:Label ID="Label3" runat="server" Text="Câu "></asp:Label>
                            <asp:Label ID="lblstt" runat="server" Text='<%# Eval("STT1") %>'></asp:Label>
                            <asp:Label ID="Label4" runat="server" Text=":"></asp:Label>
                            &nbsp;<asp:Label ID="lblND" runat="server" Text='<%# Eval("Noidung1") %>'></asp:Label>
                            <br />
                            <br />
                            <asp:UpdatePanel ID="UpdatePanel3" runat="server">
                                <ContentTemplate>
                                    <asp:RadioButton ID="RadioButton5" runat="server" 
                                        GroupName="b" oncheckedchanged="RadioButton5_CheckedChanged" 
                                        Text='<%# Eval("Pa11") %>' AutoPostBack="True" />
                                    <br />
                                    <br />
                                    <asp:RadioButton ID="RadioButton6" runat="server" 
                                        GroupName="b" oncheckedchanged="RadioButton6_CheckedChanged" 
                                        Text='<%# Eval("Pa21") %>' AutoPostBack="True" />
                                    <br />
                                    <br />
                                    <asp:RadioButton ID="RadioButton7" runat="server" 
                                        GroupName="b" oncheckedchanged="RadioButton7_CheckedChanged" 
                                        Text='<%# Eval("Pa31") %>' AutoPostBack="True" />
                                    <br />
                                    <br />
                                    <asp:RadioButton ID="RadioButton8" runat="server" 
                                        GroupName="b" oncheckedchanged="RadioButton8_CheckedChanged" 
                                        Text='<%# Eval("Pa41") %>' AutoPostBack="True" />
                                    <br />
                                </ContentTemplate>
                            </asp:UpdatePanel>
                            <br />
                            ____________________________________________________<br/>
                        </ItemTemplate>
                    </asp:DataList>
                    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                    </asp:UpdatePanel>
                </asp:Panel>
            </td>
            <td style="width:40%;">
                    <div align="left" style="color:Red;margin-left:50px; width: 145px; height: 208px;" 
                        id="lblFlowTime">THỜi GIAN CÒN LẠI&nbsp;<h1 
                            id="lblTime" align="left" 
                            
                            
                            style="margin-left:10px;background-image:url('../Images/alarm-clock-icon.png'); height: 163px;" ></h1></div>
                
            </td>
        </tr>
        <tr>
            <td>
            <asp:Panel ID="Panel3" runat="server" >
                <asp:UpdatePanel ID="UpdatePanel4" runat="server">
                    <ContentTemplate>
                        Danh sách câu hỏi<br />
                        <asp:DataList ID="DataList3" runat="server" RepeatColumns="4" 
                                    RepeatDirection="Horizontal" >
                            <ItemTemplate>
                                <asp:Panel ID="Panel4" style="-moz-border-radius: 7px;
    -webkit-border-radius: 7px;
	 margin-bottom:2px;" runat="server" BorderStyle="Groove" Height="21px" 
                                    Width="80px">
                                    <asp:CheckBox ID="chbxCauHoi" runat="server" Font-Bold="True" Height="18px" 
                                        Width="20px" />
                                    <asp:Label ID="lblCauHoi" style="cursor:pointer;" runat="server" Font-Bold="True" Text="Number"></asp:Label>
                                </asp:Panel>
                            </ItemTemplate>
                        </asp:DataList>
                    </ContentTemplate>
                </asp:UpdatePanel>
                                </asp:Panel>
                
            </td>
        </tr>
        <tr>
            <td>
                                &nbsp;</td>
        </tr>
        <tr>
            <td>
                    &nbsp;</td>
        </tr>
        <tr>
            <td>
                    &nbsp;</td>
        </tr>
        <tr>
            <td>
                    &nbsp;</td>
        </tr>
        <tr>
            <td style="width: 868px">
                <asp:Button ID="btnSubmit" style="cursor:pointer;" runat="server" onclick="btnSubmit_Click" 
                    Text="Submit" />
            </td>
        </tr>
    </table>
    
    <script type="text/javascript" >
    //Ham xac nhan ket thuc bai thi
    
    
   
   function run(lbl) {
           // alert(lbl.value);
           
            $("#<%=Panel1.ClientID %>").animate({scrollTop:(180*(lbl.valueOf()-1))},400); 
        }
   
var leave = <%=seconds%>
CounterTimer();
var interv=setInterval(CounterTimer,1000);
function popup(mylink, windowname)
{
if (! window.focus)return true;
var href;
if (typeof(mylink) == 'string')
   href=mylink;
else
   href=mylink.href;
window.open(href, windowname, 'width=450,height=250,scrollbars=no,resizable=0');
return false;
}

function CounterTimer()
{
var hour = Math.floor(leave / 3600)
var minute = Math.floor(leave / 60) - (hour * 60)
var second = Math.floor(leave) - (hour * 60 * 60) - (minute*60)
hour=hour<10 ? "0" + hour : hour;
minute=minute<10 ? "0" + minute : minute;
second=second<10 ? "0" + second : second;
var remain=hour + ":"+minute+":"+second;
leave=leave-1;
document.getElementById("lblTime").innerHTML=remain;
if(leave==180)
{
    return popup("popupnew.htm",'Notes');
    
}
if(leave==-1)
{
    alert("THÔNG BÁO! ?ã h?t gi? làm bài, nh?ng câu b?n không tr? l?i s? m?c ??nh là null. Cám ?n và h?n g?p l?i. Nh?n OK ?? chuy?n sang trang xem k?t qu?");
    interv=window.clearInterval(interv);
    
    document.getElementById('<%=btnSubmit.ClientID%>').click();
    //window.location="frmKetQuaThi.aspx";
}
}


  
    
    

  
</script>

    </asp:Content>

